package com.yl.project.lvyou.video.service.impl;

import java.util.List;
import com.yl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yl.project.lvyou.video.mapper.ScenicVideoMapper;
import com.yl.project.lvyou.video.domain.ScenicVideo;
import com.yl.project.lvyou.video.service.IScenicVideoService;
import com.yl.common.utils.text.Convert;
import com.yl.framework.config.BaseService;

/**
 * 景区视频Service业务层处理
 * 
 * @author yl
 * @date 2025-03-12
 */
@Service
public class ScenicVideoServiceImpl extends BaseService<ScenicVideo> implements IScenicVideoService 
{
    @Autowired
    private ScenicVideoMapper scenicVideoMapper;

    /**
     * 查询景区视频
     * 
     * @param id 景区视频ID
     * @return 景区视频
     */
    @Override
    public ScenicVideo selectScenicVideoById(Long id)
    {
        return scenicVideoMapper.selectScenicVideoById(id);
    }

    /**
     * 查询景区视频列表
     * 
     * @param scenicVideo 景区视频
     * @return 景区视频
     */
    @Override
    public List<ScenicVideo> selectScenicVideoList(ScenicVideo scenicVideo)
    {
        return scenicVideoMapper.selectScenicVideoList(scenicVideo);
    }

    /**
     * 新增景区视频
     * 
     * @param scenicVideo 景区视频
     * @return 结果
     */
    @Override
    public int insertScenicVideo(ScenicVideo scenicVideo)
    {
        scenicVideo.setCreateTime(DateUtils.getNowDate());
        return scenicVideoMapper.insertScenicVideo(scenicVideo);
    }

    /**
     * 修改景区视频
     * 
     * @param scenicVideo 景区视频
     * @return 结果
     */
    @Override
    public int updateScenicVideo(ScenicVideo scenicVideo)
    {
        scenicVideo.setUpdateTime(DateUtils.getNowDate());
        return scenicVideoMapper.updateScenicVideo(scenicVideo);
    }

    /**
     * 删除景区视频对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteScenicVideoByIds(String ids)
    {
        return scenicVideoMapper.deleteScenicVideoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除景区视频信息
     * 
     * @param id 景区视频ID
     * @return 结果
     */
    @Override
    public int deleteScenicVideoById(Long id)
    {
        return scenicVideoMapper.deleteScenicVideoById(id);
    }
}
